#ifndef PARSER
#define PARSER
#include<string>
#include<list>
#include"secdvm.h"

enum TokenType {
    Tok_Begin,
    Tok_LP,
    Tok_RP,
    Tok_EQ,
    Tok_LT,
    Tok_GT,
    Tok_GE,
    Tok_LE,
    Tok_ADD,
    Tok_SUB,
    Tok_DIV,
    Tok_MUL,
    Tok_MOD,
    Tok_String,
    Tok_Symbol,
    Tok_integer,
    Tok_float,
    Tok_Char,
    Tok_Quote,
    Tok_IF,
};
typedef struct token{
    int lineno;
    int offset;
    TokenType type;
    std::string  *tok;
    int len;
    struct token *next;
} Token;



Token  *makeToken(int line,int offset,TokenType type,char *start,int len);

class Parser{
    public:
        char *split;
        int splitLen ;
        Lexer *lexer;
        std::string regex;
        Parser();
        Value *parse(char *);
        std::list<Token *> *split(char *);
        Token *makeToken(int ,int,TokenType,char *,int);
        ~Parser();
};


#endif // PARSER

